#ifndef __FPM383C_H__
#define __FPM383C_H__



#include "stm32f4xx.h"
#include "freertos.h"
#include "task.h"
#include "event_groups.h"
#include "sys.h"
#include "usart.h"
#include "delay.h"
#include "semphr.h"

#define DEBUG_dgb_printf_safe_EN	1

#define EVENT_GROUP_SFM_USER_REG		0x10
#define EVENT_GROUP_SFM_USER_COMPARE	0x20
#define EVENT_GROUP_SFM_USER_TOTAL		0x40
#define EVENT_GROUP_SFM_USER_DEL_ALL	0x80
#define EVENT_GROUP_SFM_TOUCH			0x100

extern SemaphoreHandle_t  g_mutex_printf;
extern QueueHandle_t g_queue_fpm;

#define FPM_LED_RED		1
#define FPM_LED_GREEN	2
#define FPM_LED_BLUE	3


void dgb_printf_safe(const char *format, ...);
extern void fpm_init(void);
extern void fpm_send_data(int length,uint8_t FPM383C_Databuffer[]);
extern void fpm_sleep(void);
extern int32_t fpm_empty(void);
extern int32_t fpm_id_total(uint16_t *total);
extern uint8_t fpm_ctrl_led(uint8_t color);
extern const char *fpm_error_code_auto_enroll(uint8_t error_code);
extern int32_t fpm_idenify_auto(uint16_t *id);
extern int32_t fpm_enroll_auto(uint16_t id);

#endif
